<%@include file="template/configuration.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${website} || View assignments</title>
        ${stylesheet}
        ${jquery}
        ${jsdropdown}
    </head>
    <body>
        <div class="container">
            <%@include file="template/header.jsp" %>
            <div class="content">
                <h1>View all assignments</h1>
                 
                    <div class="clear margin-bottom-10"></div>
                    <div class="full-block">
                        <table class="overview">
                            <tr>
                                <th>Assignment name</th>
                                <th>Date added</th>
                                <th>Filename</th>
                                <th>Lesson</th>
                            </tr>

                            <c:forEach items="${file}" var="file">
                                 <c:set var="i" value="${i + 1}"/>
                                 <tr class="pointer <c:choose><c:when test="${i % 2 == 0}">even</c:when><c:otherwise>odd</c:otherwise></c:choose>" onclick="location.href='${url}${file.url}'">
                                     <td>${file.name}</td><td>${file.date}</td><td>${file.fileName}</td><td>${file.lesson.name}</td>
                                </tr>
                            </c:forEach>
                        </table>
                        <c:choose>
                            <c:when test="${fn:length(file)==0}">
                                There are no files at this moment.
                            </c:when>
                        </c:choose>
                    </div>
            </div>
            <%@include file="template/footer.jsp" %>
        </div>
    </body>
</html>